﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Data;

namespace Model
{
    [Serializable]
    public partial class Pot0a04
    {
        private int? _levelcode;
		private string _levelname;
		private string _muser;
		private string _listid;
		
        /// <summary>
        /// 等级代码
        /// </summary>
		public int? Levelcode
		{
			get { return _levelcode;	 }
			set { _levelcode=value;	}
		}
        /// <summary>
        /// 等级名称
        /// </summary>
		public string Levelname
		{
			get { return _levelname;	 }
			set { _levelname=value;	}
		}
        /// <summary>
        /// 用户名
        /// </summary>
		public string Muser
		{
			get { return _muser;	 }
			set { _muser=value;	}
		}
        /// <summary>
        /// 主键标识
        /// </summary>
		public string Listid
		{
			get { return _listid;	 }
			set { _listid=value;	}
		}
		
		public static List<Pot0a04> GetPot0a04ListByDataTable(DataTable dt)
		{
			if(dt == null) return null;
		    List<Pot0a04> list = new List<Pot0a04>();
		   
			foreach(DataRow dr in dt.Rows)
            {
				Pot0a04 model = GetPot0a04ByDataRow(dr);
				if(null == model) continue;
				
				list.Add(model);
            }
           return list;
		}
		
		public static Pot0a04 GetPot0a04ByDataRow(DataRow dr)
		{
			Pot0a04 model = new Pot0a04(); //实例化Pot0a04
	
			DataColumnCollection dcc = dr.Table.Columns;

			if (dcc.Contains("levelcode")&&!(dr["levelcode"] is System.DBNull))  
				model.Levelcode = ( int)dr["levelcode"];
			if (dcc.Contains("levelname")&&!(dr["levelname"] is System.DBNull))  
				model.Levelname = ( string)dr["levelname"];
			if (dcc.Contains("muser")&&!(dr["muser"] is System.DBNull))  
				model.Muser = ( string)dr["muser"];
			if (dcc.Contains("listid")&&!(dr["listid"] is System.DBNull))  
				model.Listid = ( string)dr["listid"];
			
			return model;
		}
    }
}
